﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="left.aspx.cs" Inherits="Com.CMS263.Web.manage.left" EnableViewState="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        body
        {
            background: #f0f4fa;
        }
        .CNLTreeMenu img.s
        {
            cursor: pointer;
            vertical-align: middle;
        }
        .CNLTreeMenu ul
        {
            padding: 0;
        }
        .CNLTreeMenu li
        {
            list-style: none;
            padding: 0;
        }
        #CNLTreeMenu1 ul li a
        {
            color: Red;
        }
        .Closed ul
        {
            display: none;
        }
        .Child img.s
        {
            background: none;
            cursor: default;
        }
        #CNLTreeMenu1 ul
        {
            margin: 0 0 0 10px;
        }
        #CNLTreeMenu1 img.s
        {
            width: 20px;
            height: 15px;
        }
        #CNLTreeMenu1 .Opened img.s
        {
            background: url(/manage/images/opened.gif) no-repeat 0 0;
        }
        #CNLTreeMenu1 .Closed img.s
        {
            background: url(/manage/images/closed.gif) no-repeat 0 0;
        }
        #CNLTreeMenu1 .Child img.s
        {
            background: url(/manage/images/child.gif) no-repeat 3px 5px;
        }
        #CNLTreeMenu2 ul
        {
            margin: 0 0 0 17px;
        }
        #CNLTreeMenu2 img.s
        {
            width: 17px;
            height: 15px;
        }
        #CNLTreeMenu2 .Opened img.s
        {
            background: url(skin2/opened.gif) no-repeat 4px 6px;
        }
        #CNLTreeMenu2 .Closed img.s
        {
            background: url(skin2/closed.gif) no-repeat 3px 6px;
        }
        #CNLTreeMenu2 .Child img.s
        {
            background: url(skin2/child.gif) no-repeat 3px 5px;
        }
        #CNLTreeMenu3 ul
        {
            margin: 0 0 0 17px;
        }
        #CNLTreeMenu3 img.s
        {
            width: 34px;
            height: 18px;
        }
        #CNLTreeMenu3 .Opened img.s
        {
            background: url(skin3/opened.gif) no-repeat 0 1px;
        }
        #CNLTreeMenu3 .Closed img.s
        {
            background: url(skin3/closed.gif) no-repeat 0 1px;
        }
        #CNLTreeMenu3 .Child img.s
        {
            background: url(skin3/child.gif) no-repeat 13px 2px;
        }
    </style>
    <link href="style/main.css" rel="stylesheet" type="text/css" />

    <script language="javascript" src="/manage/js/jquery-1.4.2.min.js"></script>
  
    <script language="javascript">
        $(function() {
            var item = $("#CNLTreeMenu1>ul").find("li");
            var power = '<%=power %>';
            if (power == "") {
                return;
            }
            if (power.length > 0) {
                if (power[power.length - 1] == ",") {
                    power = power.substring(0, power.length - 1);
                    //alert(power);
                }
            }
            var powerArr = power.split(",");

            for (var i = 0; i < powerArr.length; i++) {
                //得到要删除连接的对象，并找到其父节点 li，再找li的父节点，查找里面是否还有li节点，没有就删除这个最大的节点
                
                var pobj = $("#" + powerArr[i]).parent(); //li
                var gobj = pobj.parent(); //ul

                var asize = gobj.children().find("a");
                var lsize = gobj.children().find("li");
                pobj.remove();
                if (asize == 0 && lsize == 0) {
                    gobj.remove();
                }

            }

        });
    </script>
    <script language="javascript" src="js/js4cnltreemenu.js"></script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="CNLTreeMenu" id="CNLTreeMenu1">
        <h4>
            网站管理</h4>
        <p>
            <a id="AllOpen_1" href="#" onclick="MyCNLTreeMenu1.SetNodes(0);Hd(this);Sw('AllClose_1');">
                全部展开</a><a id="AllClose_1" href="#" onclick="MyCNLTreeMenu1.SetNodes(1);Hd(this);Sw('AllOpen_1');"
                    style="display: none;">全部折叠</a></p>
        <asp:Literal ID="myMenu" runat="server"></asp:Literal>
        <ul>
            <li class="Opened"><a href="#">管理</a>
                <ul>
                    <li class="Child"><a href="ManageSite/AddSiteInfo.aspx" target="mainFrame">站点管理</a></li>
                    <li class="Child"><a href="adminUser/adduser.aspx" target="mainFrame">用户管理</a></li>
                    <li class="Child"><a href="adminUser/AddUserRole.aspx" target="mainFrame">角色管理</a></li>
                    <li class="Child" style="display: block"><a href="manageArtType/AddArtType.aspx"
                        target="mainFrame">管理分类</a></li>
                    <li class="Child"><a href="/manage/ManageAttrType/AddAttributeType.aspx" target="mainFrame">
                        添加扩展属性分类</a></li>
                </ul>
            </li>
        </ul>
    </div>
    <!-- CNLTreeMenu -->
    <!--CNLTreeMenu1 End!-->

    <script type="text/javascript">
<!--
        var MyCNLTreeMenu1 = new CNLTreeMenu("CNLTreeMenu1", "li");
        MyCNLTreeMenu1.InitCss("Opened", "Closed", "Child", "images/s.gif");

                      
-->
    </script>

    </form>
</body>
</html>
